#include <iostream>
#include <vector>
#include <climits>
#include <cmath>
#include <sstream>
#include <algorithm>
using namespace std;

int findMax(vector<int> nums){
	int max = INT_MIN;
	for(size_t i = 0; i < nums.size(); ++i){
		if(nums[i] > max){
			max = nums[i];
		}
	}
	return max;
}

void print(vector<int>& nums){
	for(size_t i  = 0; i < nums.size(); ++i)
		cout << nums[i] << " ";
	cout << endl;
}

bool jollyOrNot(vector<int> nums){
	//int target = findMax(nums);
	vector<int> jumps;
	for(size_t i = 0; i < nums.size()-1; ++i){
		jumps.push_back(abs(nums[i]-nums[i+1]));
	}
	sort(jumps.begin(), jumps.end());
	for(size_t i = 1; i <= jumps.size(); ++i){
		if(jumps[i-1] != i)
			return false;
	}
	return true;
}


int main(){
	string str;
	while(getline(cin,str)){
		//format input
		vector<int> input;
		istringstream iss(str);
		int number;
		iss >> number;
		while(iss >> number){
			input.push_back(number);
		}
		//pass to jolly or not
		//if true-Jolly if false-Not jolly
		if(jollyOrNot(input))
			cout << "Jolly\n";
		else
			cout << "Not jolly\n";
	}
}
